<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
	<head>
		<meta http-equiv="content-type" content="text/html; charset=utf-8">
		<title>Syntax of Test Primitives</title>
	</head>
	<body>
		<h1>Syntax of Test Primitives</h1>

		<p>
		Tests can be defined using annotations on data methods without parameters.
		When a Poosl model is <a href="../simulating_models/run_tests.html">run as POOSL Tests</a>, all data methods with a test annotation are invoked.
		When a Poosl model is <a href="../simulating_models/run.html">run as POOSL Simulation</a>, these annotations are ignored. 
		</p>

		<p>
		The supported data method annotations are:
		<ul>
		<li>@Test <br> Indicates that this data method must be executed by the test framework. By default the test succeeds if no exception occurs.</li>
		<li>@Error <br> Override the default behavior, such that the test succeeds if any exception occurs.</li>
		<li>@Error("string") <br> Override the default behavior, such that the test succeeds if an exception occurs with the specific name "string".</li>
		<li>@Error("R{string}") <br> Override the default behavior, such that the test succeeds if an exception occurs with the regular expression "string".</li>
		<li>@Skip <br> Skip this test.</li>
		</ul>
		Exceptions can be raised implicitly (e.g., through a division by zero) or explicitly (e.g., through a call of data method <a href="BasicClasses.html#data-Object">assert</a> or <a href="BasicClasses.html#data-Object">error</a>).
		</p>

		<h2>Examples</h2>
		<img src="img/test_examples.png"/>
	</body>
</html>